package server

import (
	"net/http"

	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
)

func (s *Server) RegisterRoutes() http.Handler {
	e := echo.New()
	e.Use(middleware.Logger())
	e.Use(middleware.Recover())

	e.Group("/review")
	{
		e.GET("/:id", s.GetReviewHandler)
		e.GET("/:sender_name", s.GetReviewBySenderNameHandler)
		e.POST("/", s.CreateReviewHandler)
		e.DELETE("/:id", s.DeleteReviewHandler)

	}

	return e
}
